home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Archive / Graphics / QuickDraw GX / GX->PostScript Sample / GXToPostScript / Font Database / FontDBasePrivate.h < prev   
Encoding:
C/C++ Source or Header  |  2000-09-28  |  3.9 KB  |  117 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        FontDBasePrivate.h
  3.  
  4.      Contains:    QuickDraw GX to PostScript conversion code.
  5.                          File contains private ata structures and definitions 
  6.                         for the font database.
  7.  
  8.      Version:    Technology:    Quickdraw GX 1.1.x
  9.       
  10.      Copyright:    © 1991-1997 by Apple Computer, Inc., all rights reserved.
  11. */
  12.  
  13. #include <Collections.h>
  14. #include <GXTypes.h>
  15. #include <ScalerTypes.h>    
  16. #include "GXPrintingUniverse.h"
  17. #include "FontDatabase.h"
  18.  
  19. /***********************
  20.     struct TFDBEntry:
  21.     
  22.     This structure is the data for a document
  23.     font data base entry.
  24.     
  25. ************************/
  26. typedef struct {
  27.  
  28.     long                                firstPage;            // First page the font is used.
  29.     long                                flags;                    // font info flags.
  30.     gxFlatFontListItem    fontInfo;                // The font information.
  31.     
  32. } TFDBEntry;
  33.  
  34.  
  35. /**************************
  36.  
  37.     struct: TFontDbaseRec
  38.     
  39.     This structure is the font database.
  40.     Contains all font information for a document.
  41.     
  42. ****************************/
  43.  
  44. #define fdbThisVersion 0x00010000
  45.  
  46. typedef struct {
  47.  
  48.     Fixed                                    dbaseVersion;            // Version number of the database.
  49.     long                                    numFonts;                    // Number of fonts for the document.
  50.     
  51.     long                                    numFileFonts;            // How many fonts were in the spool file.
  52.     Handle                                hFileFonts;                // Handle containing fonts from resource file.
  53.  
  54.     Collection                        docFonts;                    // The collection of document font data offsets by font ID.
  55.     long                                    nextOffset;                // Next offset to use for adding to the database.
  56.  
  57.     scalerStreamTypeFlag    streamTypes;            // Stream types used to build prerequisites.
  58.     Collection                        prerequisites;        // Collection tag is font format, ID is prerequisite enumeration.
  59.                                                                                     //        Data is prerequisite record but enumeration is replaced with a font reference.
  60.  
  61.     long                                    currPage;                    // Current page number.
  62.     long                                    lockCount;                // Lock count for database.
  63.  
  64.     TFDBEntry                            fontDbaseInfo[1];    // Storage for font database.
  65.  
  66. } TFontDbaseRec, *TFontDbasePtr, **TFontDbaseHdl;
  67.  
  68.  
  69. #define kFontDbaseResType (ResType)'dbas'
  70.  
  71. //#pragma parameter __D0 NoGlueGetHandleSize(__A0)
  72. //pascal Size NoGlueGetHandleSize(Handle h) = 0xA025; 
  73.  
  74. #define GetHandleArray(h, index)    ((Handle*)*(h))[index]
  75.  
  76. #if THINK_C >= 5 || applec
  77.         pascal Handle XGetNextFOND(Handle fontHandle) = {0x700A, 0xA822}; /* this disappeared in the latest release of THINK C */
  78. #else
  79.         #define XGetNextFOND GetNextFOND
  80. #endif
  81.  
  82. #define pointSizeIndex            0
  83. #define styleBitsIndex            1
  84. #define rsrcIDIndex                    2
  85. #define shortsInAFATRecord    3
  86. #define bytesInAFATRecord        (shortsInAFATRecord * sizeof(short))
  87.  
  88. #define kTakeThisSfntResource        (-1)        /* this value in the point size field signals an sfnt that matched */
  89.  
  90. /**** Prototypes for intra-segment private routines ****/
  91.  
  92. OSErr FDBPrereqToHandle(gxFont theFont, scalerPrerequisiteItem *item, Handle h);
  93.  
  94. OSErr FDBFontToHandle(gxFont fontID, long glyphBits[], Handle h);
  95.  
  96. OSErr CreatePartialStreamTempFile( TFile *filerefPtr, Handle *streamHdlPtr );
  97.  
  98. void DisposePartialStreamTempFile( TFile fileref, Handle streamHdl );
  99.  
  100. /************** Prototypes for intra-segment calling of exported routines *************************/
  101.  
  102. OSErr    FontDbaseGetIndexedFont(TFontDbase fontDbase, long index, gxFont *fontID);
  103.  
  104. OSErr    FontDbaseGetIndexedPrerequisite(TFontDbase fontDbase, long idx, long *size, gxFont *theFont, scalerPrerequisiteItem *item);
  105.  
  106. OSErr    FontDbaseBuildPrerequisiteList(TFontDbase fontDbase, scalerStreamTypeFlag streamTypes, char *productDescription, Boolean useMessages, long *count);
  107.  
  108. OSErr    FontDbaseGetFontInfo(TFontDbase fontDbase, gxFont fontID, long *glyphCount, long *axisCount, long *variationCount, TfdbInfoFlags *flags);
  109.  
  110. OSErr FontDbaseSetFontFlags(TFontDbase fontDbase, gxFont fontID, TfdbInfoFlags flags);
  111.  
  112. OSErr    FontDbaseGetGlyphBits(TFontDbase fontDbase, gxFont fontID, long snapshot, unsigned long* *glyphBits, gxFontVariation* *variations);
  113.  
  114. OSErr    FontDbaseExcludePrerequisite(TFontDbase fontDbase, gxFont theFont, Boolean exclude);
  115.  
  116. OSErr FontDbaseUnion(TFontDbase source, TFontDbase target);
  117.